package com.csii.ams.controller;

import com.csii.adhoc.annotation.OperationLog;
import com.csii.ams.ArchAbn;
import com.csii.ams.service.ArchAbnService;
import com.csii.result.APIResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @description: 档案异常
 * @author: panChuanJiang
 * @create: 2021-03-19 09:04
 */
@Controller
@RequestMapping("/**/ams/archAbn")
public class ArchAbnController {
    @Resource
    private ArchAbnService archAbnService;

    @RequestMapping("addArchAbn")
    @OperationLog("档案异常登记")
    @ResponseBody
    public APIResult<?> addArchAbn(@RequestBody ArchAbn archAbn){
        archAbnService.insertArchAbn(archAbn);
        return  APIResult.successResult(null);
    }

    @RequestMapping("updateArchAbn")
    @OperationLog("更新档案异常记录")
    @ResponseBody
    public APIResult<?> updateArchAbn(@RequestBody ArchAbn archAbn){
        archAbnService.updateArchAbn(archAbn);
        return  APIResult.successResult(null);
    }

    @RequestMapping("deleteArchAbn")
    @OperationLog("删除档案异常记录")
    @ResponseBody
    public APIResult<?> deleteArchAbn(@RequestBody ArchAbn archAbn){
        archAbnService.deleteArchAbn(archAbn);
        return  APIResult.successResult(null);
    }

    @RequestMapping("queryArchAbn")
    @OperationLog("查询档案异常记录")
    @ResponseBody
    public APIResult<ArchAbn> queryArchAbn(@RequestBody ArchAbn archAbn){
        return APIResult.successResult(archAbnService.queryArchAbn(archAbn));
    }
}
